package cn.dgfy.BaseSpringBootWebProj.service;

import cn.dgfy.BaseSpringBootWebProj.entity.Demo;
import cn.dgfy.BaseSpringBootWebProj.mapper.DemoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DemoService {
	
	private final DemoMapper demoMapper;
	
	@Autowired
	public DemoService(DemoMapper demoMapper) {
		this.demoMapper = demoMapper;
	}
	
	public List<Demo> getAll() {
		return demoMapper.findAll();
	}
	
	public Demo getById(int id) {
		return demoMapper.findById(id);
	}
}
